/*
 * mainframe.h
 *
 *  Created on: 2012-8-22
 *      Author: Yangde
 */

#ifndef MAINFRAME_H_
#define MAINFRAME_H_

#include "wx/wxprec.h"

#include "wx/artprov.h"
#include "wx/dcclient.h"
#include "wx/bmpbuttn.h"
#include "wx/bitmap.h"
#include "wx/msgdlg.h"
#include "wx/filename.h"
#include "wx/msw/private.h"
#include "aui.h"
#include "../data/RecentFiles.h"

class MainFrame : public wxFrame
{

public:
    MainFrame(wxWindow* parent,
            wxWindowID id,
            const wxString& title,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);

    ~MainFrame();


private:

    wxAuiNotebook* CreateNotebook();

    void AttachMenuBar(auiMenuBar* mebubar);
    virtual bool MSWTranslateMessage(WXMSG* pMsg);

private:

    void OnEraseBackground(wxEraseEvent& evt);
    void OnSize(wxSizeEvent& evt);
    void OnNewTab(wxCommandEvent& evt);
    void OnFileOpen(wxCommandEvent& evt);
    void FileOpen (wxString fname);

    void OnExit(wxCommandEvent& evt);
    void OnAbout(wxCommandEvent& evt);

private:

    wxAuiManager m_mgr;

    auiMenuBar* m_menubar;
    wxAuiNotebook* m_main_tab;

    RecentFiles recent_open;
    DECLARE_EVENT_TABLE()
};


#endif /* MAINFRAME_H_ */
